const TokenKey = 'token'
const RefreshTokenKey = 'refresh_token'
const PermissionMenuKey = 'permission_menu'
const UserKey = 'user'
const EnumsKey = 'Enums'

//token
export function getToken() {
  return localStorage.getItem(TokenKey)
}
export function setToken(token) {
  return localStorage.setItem(TokenKey,token)
}
export function removeToken() {
  return localStorage.removeItem(TokenKey)
}

//refresh_token
export function getRefreshToken() {
  return localStorage.getItem(RefreshTokenKey)
}
export function setRefreshToken(token) {
  return localStorage.setItem(RefreshTokenKey,token)
}
export function removeRefreshToken() {
  return localStorage.removeItem(RefreshTokenKey,token)
}

//PermissionMenu
export function setPermissionMenu(obj) {
  return localStorage.setItem(PermissionMenuKey,JSON.stringify(obj))
}
export function getPermissionMenu() {
  return JSON.parse(localStorage.getItem(PermissionMenuKey))
}

export function removePermissionMenu() {
  return localStorage.removeItem(PermissionMenuKey)
}

//user
export function setUser(obj) {
  return localStorage.setItem(UserKey,JSON.stringify(obj))
}
export function getUser() {
  return JSON.parse(localStorage.getItem(UserKey))
}
export function removeUser() {
  return localStorage.removeItem(UserKey)
}

//Enums
export function setEnums(obj) {
  return localStorage.setItem(EnumsKey,JSON.stringify(obj))
}
export function getEnums() {
  return JSON.parse(localStorage.getItem(EnumsKey))
}
export function removeEnums() {
  return localStorage.removeItem(EnumsKey)
}


